package com.iflytek.astron.console.commons.constant;

import lombok.Getter;

/**
 * Response code enumeration class
 */
public enum ResponseEnum {
    SUCCESS(0, "system.success"),
    // SSO Server 3xxxx
    INCORRECT_PASSWORD(30001, "auth.password.incorrect"),

    // Client errors 4xxxx
    BAD_REQUEST(40000, "http.bad.request"),
    UNAUTHORIZED(40001, "http.unauthorized"),
    FORBIDDEN(40003, "http.forbidden"),
    NOT_FOUND(40004, "http.not.found"),
    METHOD_NOT_ALLOWED(40005, "http.method.not.allowed"),
    REQUEST_TIMEOUT(40008, "http.request.timeout"),
    CONFLICT(40009, "http.conflict"),
    UNSUPPORTED_MEDIA_TYPE(40015, "http.unsupported.media.type"),
    PARAMETER_ERROR(40022, "http.parameter.error"),
    VALIDATION_ERROR(40023, "http.validation.error"),
    TOO_MANY_REQUESTS(40029, "http.too.many.requests"),

    // Server errors 5xxxx
    INTERNAL_SERVER_ERROR(50000, "http.internal.server.error"),
    SERVICE_UNAVAILABLE(50003, "http.service.unavailable"),
    GATEWAY_TIMEOUT(50004, "http.gateway.timeout"),
    S3_UPLOAD_ERROR(50005, "system.s3.upload.error"),
    S3_PRESIGN_ERROR(50006, "system.s3.presign.error"),

    // Business errors 6xxxx
    BUSINESS_ERROR(60000, "error.business"),
    DATA_NOT_FOUND(60001, "error.data.not.found"),
    DATA_ALREADY_EXISTS(60002, "error.data.already.exists"),
    OPERATION_FAILED(60003, "error.operation.failed"),
    INSUFFICIENT_PERMISSIONS(60004, "error.insufficient.permissions"),
    CHAT_REQ_ERROR(60005, "error.chat.req"),
    BOT_NOT_EXISTS(60006, "error.bot.not.exists"),
    CHAT_LIST_ERROR(60007, "error.chat.list"),
    BOT_STATUS_NOT_ALLOW_PUBLISH(60021, "error.bot.status.not.allow.publish"),
    BOT_STATUS_NOT_ALLOW_OFFLINE(60022, "error.bot.status.not.allow.offline"),
    BOT_UPDATE_FAILED(60023, "error.bot.update.failed"),

    // WeChat related errors 60024-60030
    WECHAT_AUTH_FAILED(60024, "error.wechat.auth.failed"),
    WECHAT_VERIFY_TICKET_MISSING(60025, "error.wechat.verify.ticket.missing"),
    WECHAT_BIND_FAILED(60026, "error.wechat.bind.failed"),
    WECHAT_UNBIND_FAILED(60027, "error.wechat.unbind.failed"),

    CHAT_REQ_NOT_BELONG_ERROR(60008, "error.chat.req.not.belong"),
    CHAT_TREE_ERROR(60009, "error.chat.tree"),
    CHAT_NORMAL_TREE_ERROR(60010, "error.chat.normal.tree"),
    LOGIN_INFO_ERROR(60011, "error.login.info"),
    USER_NO_APPROVEL(60012, "error.user.no.approvel"),
    PARAMS_ERROR(60013, "error.params"),
    BOT_CHAIN_SUBMIT_ERROR(60014, "error.bot.chain.submit"),
    CHAT_REQ_ZJ_ERROR(60015, "error.chat.req.zj"),
    LONG_CONTENT_CHAT_ID_ERROR(60016, "error.long.content.chat.id"),
    LONG_CONTENT_WRONG_BUSINESS_TYPE(60017, "error.long.content.wrong.business.type"),
    LONG_CONTENT_MISS_FILE_INFO(60018, "error.long.content.miss.file.info"),
    LONG_CONTENT_FILE_SIZE_OUT_LIMIT(60019, "error.long.content.file.size.out.limit"),
    LONG_CONTENT_FILE_NUM_OUT_LIMIT(60020, "error.long.content.file.num.out.limit"),
    TOO_MANY_BOTS(60021, "error.too.many.bots"),
    DUPLICATE_BOT_NAME(60022, "error.duplicate.bot.name"),
    CREATE_BOT_FAILED(60023, "error.create.bot.failed"),
    UPDATE_BOT_FAILED(60024, "error.update.bot.failed"),
    BOT_BELONG_ERROR(60025, "error.bot.belong.error"),
    BOT_STATUS_INVALID(60026, "error.bot.status.invalid"),
    SHARE_URL_INVALID(60027, "error.share.url.invalid"),
    FILE_NOT_PROCESS(60028, "error.file.not.process"),
    CLONE_BOT_FAILED(60029, "error.clone.bot.failed"),
    ACTIVITY_NOT_FOUND_ERROR(60030, "error.activity.not.found"),
    BOT_CHAIN_UPDATE_ERROR(60031, "error.bot.chain.update.error"),

    USER_APP_ID_CREATE_ERROR(60032, "error.app.create.failed"),
    USER_APP_NAME_REPEAT(60033, "error.app.create.name.repeat"),
    BOT_API_CREATE_LIMIT_ERROR(60034, "error.bot.api.create.limited"),

    BOT_API_CREATE_REPEAT(60035, "error.bot.api.create.repeat"),

    USER_API_ID_NOT_EXISTE(60036, "error.api.not.exists"),

    BOT_API_CREATE_ERROR(60037, "error.bot.api.create.failed"),

    BOT_TYPE_NOT_SUPPORT(60038, "error.bot.type.temporarily.not.support"),
    USER_APP_ID_NOT_EXISTE(60039, "error.app.not.exists"),
    PERSONALITY_AI_GENERATE_PARAM_EMPTY(60040, "error.personality.ai.generate.param.empty"),
    PERSONALITY_AI_GENERATE_ERROR(60041, "error.personality.ai.generate.failed"),
    AUDIO_FILE_FORMAT_UNSUPPORTED(60042, "error.audio.file.format.unsupported"),
    AUDIO_FILE_SIZE_EXCEEDED(60043, "error.audio.file.size.exceeded"),
    AUDIO_CHANNELS_INVALID(60044, "error.audio.channels.invalid"),
    AUDIO_SAMPLE_RATE_TOO_LOW(60045, "error.audio.sample.rate.too.low"),
    AUDIO_BIT_DEPTH_INVALID(60046, "error.audio.bit.depth.invalid"),
    AUDIO_DURATION_TOO_LONG(60047, "error.audio.duration.too.long"),
    SPEAKER_TRAIN_FAILED(60048, "error.speaker.train.failed"),

    // Spark API errors 60040-60080
    SPARK_API_PARAM_ERROR(60040, "error.spark.api.param.error"),
    SPARK_API_UPGRADE_WS_ERROR(60041, "error.spark.api.upgrade.ws"),
    SPARK_API_READ_MESSAGE_ERROR(60042, "error.spark.api.read.message"),
    SPARK_API_SEND_MESSAGE_ERROR(60043, "error.spark.api.send.message"),
    SPARK_API_MESSAGE_FORMAT_ERROR(60044, "error.spark.api.message.format"),
    SPARK_API_SCHEMA_ERROR(60045, "error.spark.api.schema.error"),
    SPARK_API_PARAM_VALUE_ERROR(60046, "error.spark.api.param.value.error"),
    SPARK_API_CONCURRENT_ERROR(60047, "error.spark.api.concurrent.error"),
    SPARK_API_FLOW_LIMIT_ERROR(60048, "error.spark.api.flow.limit.error"),
    SPARK_API_CAPACITY_INSUFFICIENT(60049, "error.spark.api.capacity.insufficient"),
    SPARK_API_ENGINE_CONNECTION_FAILED(60050, "error.spark.api.engine.connection.failed"),
    SPARK_API_ENGINE_RECEIVE_ERROR(60051, "error.spark.api.engine.receive.error"),
    SPARK_API_ENGINE_SEND_ERROR(60052, "error.spark.api.engine.send.error"),
    SPARK_API_ENGINE_INTERNAL_ERROR(60053, "error.spark.api.engine.internal.error"),
    SPARK_API_INPUT_CONTENT_AUDIT_FAILED(60054, "error.spark.api.input.content.audit.failed"),
    SPARK_API_OUTPUT_CONTENT_AUDIT_FAILED(60055, "error.spark.api.output.content.audit.failed"),
    SPARK_API_APPID_IN_BLACKLIST(60056, "error.spark.api.appid.in.blacklist"),
    SPARK_API_AUTHORIZATION_ERROR(60057, "error.spark.api.authorization.error"),
    SPARK_API_CLEAR_HISTORY_FAILED(60058, "error.spark.api.clear.history.failed"),
    SPARK_API_INPUT_VIOLATION_TENDENCY(60059, "error.spark.api.input.violation.tendency"),
    SPARK_API_INPUT_AUDIT_FAILED(60060, "error.spark.api.input.audit.failed"),
    SPARK_API_SERVICE_BUSY(60061, "error.spark.api.service.busy"),
    SPARK_API_ENGINE_PARAM_ERROR(60062, "error.spark.api.engine.param.error"),
    SPARK_API_ENGINE_NETWORK_ERROR(60063, "error.spark.api.engine.network.error"),
    SPARK_API_TOKEN_LIMIT_EXCEEDED(60064, "error.spark.api.token.limit.exceeded"),
    SPARK_API_NO_AUTHORIZATION(60065, "error.spark.api.no.authorization"),
    SPARK_API_DAILY_LIMIT_EXCEEDED(60066, "error.spark.api.daily.limit.exceeded"),
    SPARK_API_QPS_LIMIT_EXCEEDED(60067, "error.spark.api.qps.limit.exceeded"),
    SPARK_API_CONCURRENT_LIMIT_EXCEEDED(60068, "error.spark.api.concurrent.limit.exceeded"),
    SPARK_API_IMAGE_AUDIT_FAILED(60069, "error.spark.api.image.audit.failed"),
    SPARK_API_IMAGE_NOT_AUTH(60070, "error.spark.api.image.not.auth"),
    SPARK_API_IMAGE_PARAM_ERROR(60071, "error.spark.api.image.param.error"),
    SPARK_API_IMAGE_MESSAGE_FORMAT_ERROR(60072, "error.spark.api.image.message.format"),
    SPARK_API_IMAGE_SCHEMA_ERROR(60073, "error.spark.api.image.schema.error"),
    SPARK_API_IMAGE_PARAM_VALUE_ERROR(60074, "error.spark.api.image.param.value.error"),
    SPARK_API_IMAGE_CAPACITY_INSUFFICIENT(60075, "error.spark.api.image.capacity.insufficient"),
    SPARK_API_IMAGE_INPUT_AUDIT_FAILED(60076, "error.spark.api.image.input.audit.failed"),

    // Space application related errors
    SPACE_APPLICATION_PLEASE_JOIN_ENTERPRISE_FIRST(61001, "space.application.please.join.enterprise.first"),
    SPACE_APPLICATION_DUPLICATE_NOT_ALLOWED(61002, "space.application.duplicate.not.allowed"),
    SPACE_APPLICATION_USER_ALREADY_IN_SPACE(61003, "space.application.user.already.in.space"),
    SPACE_APPLICATION_JOIN_FAILED(61004, "space.application.join.failed"),
    SPACE_APPLICATION_FAILED(61005, "space.application.failed"),
    SPACE_APPLICATION_RECORD_NOT_FOUND(61006, "space.application.record.not.found"),
    SPACE_APPLICATION_CURRENT_SPACE_INCONSISTENT(61007, "space.application.current.space.inconsistent"),
    SPACE_APPLICATION_STATUS_INCORRECT(61008, "space.application.status.incorrect"),
    SPACE_APPLICATION_APPROVAL_FAILED(61009, "space.application.approval.failed"),

    // Enterprise team related errors
    ENTERPRISE_NOT_EXISTS(62001, "enterprise.not.exists"),
    ENTERPRISE_USER_NOT_IN_ENTERPRISE(62002, "enterprise.user.not.in.enterprise"),
    ENTERPRISE_PLEASE_BUY_PLAN_FIRST(62003, "enterprise.please.buy.plan.first"),
    ENTERPRISE_NAME_EXISTS(62004, "enterprise.name.exists"),
    ENTERPRISE_USER_ALREADY_CREATED_ENTERPRISE(62005, "enterprise.user.already.created"),
    ENTERPRISE_CREATE_FAILED(62006, "enterprise.create.failed"),
    ENTERPRISE_UPDATE_FAILED(62007, "enterprise.update.failed"),

    // Enterprise team user related errors
    ENTERPRISE_TEAM_USER_NOT_IN_TEAM(63001, "enterprise.user.not.in.team"),
    ENTERPRISE_TEAM_SUPER_ADMIN_CANNOT_BE_REMOVED(63002, "enterprise.user.super.admin.cannot.be.removed"),
    ENTERPRISE_TEAM_REMOVE_USER_FAILED(63003, "enterprise.user.remove.failed"),
    ENTERPRISE_TEAM_ROLE_TYPE_INCORRECT(63005, "enterprise.user.role.type.incorrect"),
    ENTERPRISE_TEAM_UPDATE_ROLE_FAILED(63006, "enterprise.user.update.role.failed"),
    ENTERPRISE_TEAM_SUPER_ADMIN_CANNOT_LEAVE_TEAM(63008, "enterprise.user.super.admin.cannot.leave.team"),
    ENTERPRISE_TEAM_LEAVE_FAILED(63009, "enterprise.user.leave.failed"),

    // Invitation management related errors
    INVITE_SPACE_USER_FULL(64001, "invite.space.user.full"),
    INVITE_TEAM_USER_FULL(64002, "invite.team.user.full"),
    INVITE_ENTERPRISE_USER_FULL(64003, "invite.enterprise.user.full"),
    INVITE_USER_ALREADY_SPACE_MEMBER(64004, "invite.user.already.space.member"),
    INVITE_USER_ALREADY_INVITED(64005, "invite.user.already.invited"),
    INVITE_FAILED(64006, "invite.failed"),
    INVITE_USER_ALREADY_TEAM_MEMBER(64007, "invite.user.already.team.member"),
    INVITE_RECORD_NOT_FOUND(64009, "invite.record.not.found"),
    INVITE_CURRENT_USER_NOT_INVITEE(64010, "invite.current.user.not.invitee"),
    INVITE_ALREADY_REFUSED(64011, "invite.already.refused"),
    INVITE_ALREADY_ACCEPTED(64012, "invite.already.accepted"),
    INVITE_ALREADY_WITHDRAWN(64013, "invite.already.withdrawn"),
    INVITE_ALREADY_EXPIRED(64014, "invite.already.expired"),
    INVITE_ENTERPRISE_INCONSISTENT(64015, "invite.enterprise.inconsistent"),
    INVITE_STATUS_NOT_SUPPORTED(64016, "invite.status.not.supported"),
    INVITE_PLEASE_UPLOAD_PHONE_NUMBERS(64017, "invite.please.upload.phone.numbers"),
    INVITE_EXCEED_BATCH_IMPORT_LIMIT(64018, "invite.exceed.batch.import.limit"),
    INVITE_NO_CORRESPONDING_USERS_FOUND(64019, "invite.no.corresponding.users.found"),
    INVITE_READ_UPLOAD_FILE_FAILED(64020, "invite.read.upload.file.failed"),
    INVITE_ADD_TEAM_USER_FAILED(64021, "invite.add.team.user.failed"),
    INVITE_ADD_SPACE_USER_FAILED(64022, "invite.add.space.user.failed"),
    INVITE_UNSUPPORTED_TYPE(64023, "invite.unsupported.type"),
    INVITE_PARAMETER_EXCEPTION(64024, "invite.parameter.exception"),
    INVITE_SPACE_ALREADY_DELETED(64025, "invite.space.already.deleted"),
    INVITE_PLEASE_UPLOAD_USERNAMES(64026, "invite.please.upload.usernames"),

    // Space management related errors
    SPACE_NAME_EXISTS(65001, "space.name.exists"),
    SPACE_ENTERPRISE_TEAM_MAX_EXCEEDED(65002, "space.enterprise.team.max.exceeded"),
    SPACE_PERSONAL_PRO_MAX_EXCEEDED(65003, "space.personal.pro.max.exceeded"),
    SPACE_FREE_USER_MAX_EXCEEDED(65004, "space.free.user.max.exceeded"),
    SPACE_NOT_EXISTS(65005, "space.not.exists"),
    SPACE_DELETE_FAILED(65007, "space.delete.failed"),
    SPACE_NAME_DUPLICATE(65008, "space.name.duplicate"),
    SPACE_USER_NOT_IN_SPACE(65009, "space.user.not.in.space"),
    SPACE_USER_NOT_OWNER(65010, "space.user.not.owner"),
    SPACE_USER_NOT_ENTERPRISE_USER(65011, "space.user.not.enterprise.user"),
    SPACE_USER_NOT_ENTERPRISE_ADMIN(65012, "space.user.not.enterprise.admin"),

    // Space user management related errors
    SPACE_USER_UNSUPPORTED_ROLE_TYPE(66001, "space.user.unsupported.role.type"),
    SPACE_USER_SPACE_NOT_BELONG_TO_ENTERPRISE(66002, "space.user.space.not.belong.to.enterprise"),
    SPACE_USER_NOT_IN_ENTERPRISE_TEAM(66003, "space.user.not.in.enterprise.team"),
    SPACE_USER_ALREADY_EXISTS(66004, "space.user.already.exists"),
    SPACE_USER_ADD_FAILED(66005, "space.user.add.failed"),
    SPACE_USER_NOT_EXISTS(66006, "space.user.not.exists"),
    SPACE_USER_CANNOT_REMOVE_OWNER(66007, "space.user.cannot.remove.owner"),
    SPACE_USER_REMOVE_FAILED(66008, "space.user.remove.failed"),
    SPACE_USER_OWNER_ROLE_CANNOT_CHANGE(66009, "space.user.owner.role.cannot.change"),
    SPACE_USER_OWNER_CANNOT_LEAVE(66010, "space.user.owner.cannot.leave"),
    SPACE_USER_PERSONAL_SPACE_CANNOT_TRANSFER(66011, "space.user.personal.space.cannot.transfer"),
    SPACE_USER_NON_OWNER_CANNOT_TRANSFER(66012, "space.user.non.owner.cannot.transfer"),
    SPACE_USER_NOT_MEMBER(66013, "space.user.not.member"),
    SPACE_USER_TRANSFER_FAILED(66014, "space.user.transfer.failed"),

    // Permission validation related errors
    PERMISSION_NO_ENTERPRISE_ID(67001, "permission.no.enterprise.id"),
    PERMISSION_NOT_BELONG_ENTERPRISE(67002, "permission.not.belong.enterprise"),
    PERMISSION_NOT_SUPPORT_ENTERPRISE_ROLE(67003, "permission.not.support.enterprise.role"),
    PERMISSION_NO_ENTERPRISE_CONFIG(67004, "permission.no.enterprise.config"),
    PERMISSION_DENIED(67005, "permission.denied"),
    PERMISSION_PACKAGE_EXPIRED(67006, "permission.package.expired"),
    PERMISSION_NOT_BELONG_SPACE(67007, "permission.not.belong.space"),
    PERMISSION_NOT_SUPPORT_SPACE_ROLE(67008, "permission.not.support.space.role"),
    PERMISSION_NO_SPACE_CONFIG(67009, "permission.no.space.config"),
    PERMISSION_NO_SPACE_ID(67010, "permission.no.space.id"),
    PERMISSION_BOT_NOT_BELONG_USER(67011, "permission.bot.belong.wrong.user"),
    PERMISSION_BOT_NOT_BELONG_SPACE(67012, "permission.bot.belong.wrong.space"),

    // ================================== 8000 defines enum method return values
    // ===========================================
    // Basic exceptions 8000 - 8100
    MODEL_URL_CHECK_FAILED(8000, "model.url.check.failed"),
    RESPONSE_FAILED(8001, "common.response.failed"),
    PARAM_MISS(8002, "param.miss"),
    APPID_CANNOT_EMPTY(8003, "appid.cannot.empty"),
    FILE_EMPTY(8004, "file.empty"),
    PARAM_ERROR(8005, "param.error"),
    FILTER_CONF_MISS(8006, "filter.conf.miss"),
    EXCEED_AUTHORITY(8007, "exceed.authority"),
    PAGE_SEPARATOR_MISS(8008, "exceed.authority"),
    DELIMITER_SAME(8009, "delimiter.same"),
    DATA_NOT_EXIST(8010, "data.not.exist"),
    COMMON_BASE_CONFIG_NOT_EXIST(8011, "common.base.config.not.exist"),
    COMMON_REMOTE_CALLER_FAILED(8012, "common.remote.caller.failed"),
    FAILED_GET_TRACE(8013, "failed.get.trace"),

    // Workflow 8100 - 8300
    WORKFLOW_VERSION_ADD_FAILED(8100, "workflow.version.add.failed"),
    WORKFLOW_VERSION_GET_NAME_FAILED(8101, "workflow.version.get.name.failed"),
    WORKFLOW_VERSION_REDUCTION_FAILED(8102, "workflow.version.reduction.failed"),
    WORKFLOW_VERSION_PUBLISH_FAILED(8103, "workflow.version.publish.failed"),
    WORKFLOW_VERSION_GET_MAX_FAILED(8104, "workflow.version.get.max.failed"),
    WORKFLOW_DSL_UPLOAD_FAILED(8105, "workflow.dsl.upload.failed"),
    WORKFLOW_TEMPLATE_NOT_EXIST(8106, "workflow.template.not.exist"),
    WORKFLOW_HIGH_PARAM_FAILED(8107, "workflow.high.param.failed"),
    WORKFLOW_PROTOCOL_NODE_INFO_CANNOT_EMPTY(8108, "workflow.protocol.node.info.cannot.empty"),
    WORKFLOW_PROTOCOL_LENGTH_LIMIT(8109, "workflow.protocol.length.limit"),
    WORKFLOW_NOT_EXIST(8110, "workflow.not.exist"),
    WORKFLOW_FEEDBACK_FAILED(8111, "workflow.feedback.failed"),
    WORKFLOW_QUERY_LENGTH_OUTRANGE(8112, "workflow.query.length.outrange"),
    WORKFLOW_EXPORT_FAILED(8113, "workflow.export.failed"),
    WORKFLOW_VERSION_NOT_FOUND(8114, "workflow.version.not.found"),
    WORKFLOW_NAME_EXISTED(8115, "workflow.name.existed"),
    WORKFLOW_NOT_PUBLIC(8116, "workflow.not.public"),
    WORKFLOW_NOT_PUBLISH(8117, "workflow.not.publish"),
    WORKFLOW_IMPORT_FAILED(8118, "workflow.import.failed"),
    NO_WORKFLOW(8119, "workflow.no.workflow"),
    PARSE_INPUT_PARAM_TYPE_FAILED(8120, "parse.input.param.type.failed"),
    WORKFLOW_PROTOCOL_EMPTY(8121, "workflow.protocol.empty"),
    BOT_NOT_EXIST(8122, "bot.not.exist"),
    PROMPT_GROUP_SAVE_FAILED(8123, "prompt.group.save.failed"),
    PROMPT_GROUP_PROMPT_CANNOT_EMPTY(8124, "prompt.group.prompt.cannot.empty"),
    WORKFLOW_DLS_UPLOAD_FAILED(8125, "work.flow.dls.upload.failed"),
    WORKFLOW_MCP_SERVER_REGISTRY_FAILED(8126, "work.flow.mcp.server.registry.failed"),


    // Plugins 8300 - 8500
    TOOLBOX_NOT_EXIST_MODIFY(8300, "toolbox.not.exist.modify"),
    TOOLBOX_NOT_EXIST_DELETE(8301, "toolbox.not.exist.delete"),
    TOOLBOX_CANNOT_DELETE_RELATED(8302, "toolbox.cannot.delete.related"),
    TOOLBOX_NOT_EXIST(8303, "toolbox.not.exist"),
    TOOLBOX_ALREADY_COLLECT(8304, "toolbox.already.collect"),
    TOOLBOX_NO_COLLECT(8305, "toolbox.no.collect"),
    TOOLBOX_PARAM_TYPE_CANNOT_EMPTY(8306, "toolbox.param.type.cannot.empty"),
    TOOLBOX_PARAM_CANNOT_EMPTY(8307, "toolbox.param.cannot.empty"),
    TOOLBOX_PARAM_AND_DESC_CANNOT_EMPTY(8308, "toolbox.param.and.desc.cannot.empty"),
    TOOLBOX_PARAM_GET_SOURCE_ILLEGAL(8309, "toolbox.param.get.source.illegal"),
    TOOLBOX_PARAM_TYPE_NOT_MATCH(8310, "toolbox.param.type.not.match"),
    TOOLBOX_URL_ILLEGAL(8311, "toolbox.url.illegal"),
    TOOLBOX_IP_IN_BLACKLIST(8312, "toolbox.ip.in.blacklist"),
    TOOLBOX_URL_SHORT_NOT_SUPPORTED(8313, "toolbox.url.short.not.supported"),
    TOOLBOX_URL_HTTP_HTTPS_ONLY(8314, "toolbox.url.http.https.only"),
    TOOLBOX_ADD_VERSION_FAILED(8315, "toolbox.add.version.failed"),
    TOOLBOX_CANNOT_DELETE_RELATED_WORKFLOW(8316, "toolbox.cannot.delete.related.workflow"),
    TOOLBOX_NOT_NUMBER_TYPE(8317, "toolbox.not.number.type"),
    TOOLBOX_NOT_INTEGER_TYPE(8318, "toolbox.not.integer.type"),
    TOOLBOX_NOT_BOOLEAN_TYPE(8319, "toolbox.not.boolean.type"),
    TOOLBOX_MCP_WRITE_FAILED(8320, "toolbox.mcp.write.failed"),
    TOOLBOX_MCP_REG_FAILED(8321, "toolbox.mcp.reg.failed"),
    TOOLBOX_NAME_EMPTY(8322, "toolbox.name.empty"),
    FAILED_MCP_REG(8323, "workflow.mcp.server.registry.failed"),
    FAILED_TOOL_CALL(8324, "toolbox.tool.call.failed"),
    FAILED_MCP_GET_DETAIL(8325, "toolbox.mcp.get.detail.failed"),
    FAILED_AUTH(8326, "toolbox.auth.failed"),
    FAILED_GENERATE_SERVER_URL(8327, "toolbox.generate.server.url.failed"),
    RPA_IS_USAGE(8328, "rpa.is.usage"),

    // Database 8500 - 8700
    DATABASE_NAME_NOT_EMPTY(8500, "database.name.not.empty"),
    DATABASE_NAME_EXIST(8501, "database.name.exist"),
    DATABASE_CREATE_FAILED(8502, "database.create.failed"),
    DATABASE_UPDATE_FAILED(8503, "database.update.failed"),
    DATABASE_DELETE_FAILED_CITED(8504, "database.delete.failed.cited"),
    DATABASE_QUERY_FAILED(8505, "database.query.failed"),
    DATABASE_NOT_EXIST(8506, "database.not.exist"),
    DATABASE_TABLE_NAME_EXIST(8507, "database.table.name.exist"),
    DATABASE_TABLE_FIELD_CANNOT_EMPTY(8508, "database.table.field.cannot.empty"),
    DATABASE_TABLE_CREATE_FAILED(8509, "database.table.create.failed"),
    DATABASE_ID_CANNOT_EMPTY(8510, "database.id.cannot.empty"),
    DATABASE_TABLE_QUERY_LIST_FAILED(8511, "database.table.query.list.failed"),
    DATABASE_TABLE_QUERY_FIELD_FAILED(8512, "database.table.query.field.failed"),
    DATABASE_TABLE_UPDATE_FAILED(8513, "database.table.update.failed"),
    DATABASE_TABLE_DELETE_FAILED_CITED(8514, "database.table.delete.failed.cited"),
    DATABASE_TABLE_DELETE_FAILED(8515, "database.table.delete.failed"),
    DATABASE_TABLE_OPERATION_FAILED(8516, "database.table.operation.failed"),
    DATABASE_TABLE_FIELD_ILLEGAL(8517, "database.table.field.illegal"),
    DATABASE_TABLE_FIELD_LACK(8518, "database.table.field.lack"),
    DATABASE_TEMPLATE_GENERATE_FAILED(8519, "database.template.generate.failed"),
    DATABASE_TABLE_QUERY_DATA_FAILED(8520, "database.table.query.data.failed"),
    DATABASE_IMPORT_FAILED(8521, "database.import.failed"),
    DATABASE_TABLE_COPY_FAILED(8522, "database.table.copy.failed"),
    DATABASE_CANNOT_EMPTY(8523, "database.cannot.empty"),
    DATABASE_TYPE_ILLEGAL(8524, "database.type.illegal"),
    DATABASE_COPY_FAILED(8525, "database.copy.failed"),
    DATABASE_COUNT_LIMITED(8526, "database.count.limited"),
    DATABASE_FIELD_CANNOT_BEYOND_20(8527, "database.field.cannot.beyond.20"),
    DATABASE_TABLE_EXPORT_FAILED(8528, "database.table.export.failed"),
    DATABASE_TABLE_ILLEGAL_DEFAULT(8529, "database.table.illegal.default"),
    DATABASE_TABLE_FIELD_IMPORT_DEFAULT(8530, "database.table.field.import.default"),
    DATABASE_TOO_MANY_EXPORT_IDS(8531, "database.too.many.export.ids"),

    // Knowledge base 8700 - 8900
    REPO_NAME_DUPLICATE(8700, "repo.name.duplicate"),
    REPO_TYPE_NOT_MATCH(8701, "repo.type.not.match"),
    REPO_NOT_EXIST(8702, "repo.not.exist"),
    REPO_SUBSCRIPTION_FAILED(8703, "repo.subscription.failed"),
    REPO_STATUS_ILLEGAL(8704, "repo.status.illegal"),
    REPO_FILE_UPLOAD_FAILED_PIC_5MB(8705, "repo.file.upload.failed.pic.5mb"),
    REPO_FILE_UPLOAD_FAILED_FILE_20MB(8706, "repo.file.upload.failed.file.20mb"),
    REPO_FILE_UPLOAD_FAILED_WORDS_100W(8707, "repo.file.upload.failed.words.100w"),
    REPO_FILE_TYPE_EMPTY_XINGCHEN(8708, "repo.file.type.empty.xingchen"),
    REPO_FILE_UPLOAD_FAILED_FILE_10MB_XINGCHEN(8709, "repo.file.upload.failed.file.10mb.xingchen"),
    REPO_FILE_UPLOAD_FAILED_FILE_100MB_XINGCHEN(8710, "repo.file.upload.failed.file.100mb.xingchen"),
    REPO_FILE_UPLOAD_FAILED(8711, "repo.file.upload.failed"),
    REPO_FILE_SLICE_FAILED(8712, "repo.file.slice.failed"),
    REPO_FILE_SLICE_RANGE_16_1024(8713, "repo.file.slice.range.16.1024"),
    REPO_FILE_ALL_CLEAN_FAILED(8714, "repo.file.all.clean.failed"),
    REPO_FILE_GET_KNOWLEDGE_FAILED(8715, "repo.file.get.knowledge.failed"),
    REPO_FILE_EMBEDDING_FAILED(8716, "repo.file.embedding.failed"),
    REPO_FILE_SIZE_LIMITED(8717, "repo.file.size.limited"),
    REPO_FILE_NAME_CANNOT_EMPTY(8718, "repo.file.name.cannot.empty"),
    REPO_FOLDER_NAME_ILLEGAL(8719, "repo.folder.name.illegal"),
    REPO_FILE_NOT_EXIST(8720, "repo.file.not.exist"),
    REPO_FILE_DELETE_FAILED(8721, "repo.file.delete.failed"),
    REPO_FOLDER_NOT_EXIST(8722, "repo.folder.not.exist"),
    REPO_FILE_DOWNLOAD_FAILED(8723, "repo.file.download.failed"),
    REPO_KNOWLEDGE_NOT_EXIST(8724, "repo.knowledge.not.exist"),
    REPO_KNOWLEDGE_GET_FAILED(8725, "repo.knowledge.get.failed"),
    REPO_KNOWLEDGE_ALL_EMBEDDING_FAILED(8726, "repo.knowledge.all.embedding.failed"),
    REPO_KNOWLEDGE_NO_TASK(8727, "repo.knowledge.no.task"),
    REPO_KNOWLEDGE_DOWNLOAD_FAILED(8728, "repo.knowledge.download.failed"),
    REPO_KNOWLEDGE_ADD_FAILED(8729, "repo.knowledge.add.failed"),
    REPO_KNOWLEDGE_MODIFY_FAILED(8730, "repo.knowledge.modify.failed"),
    REPO_KNOWLEDGE_DELETE_FAILED(8731, "repo.knowledge.delete.failed"),
    REPO_KNOWLEDGE_TAG_TOO_LONG(8732, "repo.knowledge.tag.too.long"),
    REPO_KNOWLEDGE_SPLITTING(8733, "repo.knowledge.splitting"),
    REPO_SOME_IDS_MUST_INPUT(8734, "repo.some.ids.must.input"),
    REPO_NOT_FOUND(8735, "repo.not.found"),
    REPO_FILE_DISABLED(8736, "repo.file.disabled"),
    REPO_KNOWLEDGE_QUERY_FAILED(8737, "repo.knowledge.query.failed"),
    REPO_DELETE_FAILED_BOT_USED(8738, "repo.delete.failed.bot.used"),
    REPO_FILE_UPLOAD_TYPE_NOT_EXIST(8739, "repo.file.upload.type.not.exist"),

    // 8900 - 9000 (Model related)
    MODEL_NOT_COMPATIBLE_OPENAI(8900, "model.not.compatible.openai"),
    MODEL_APIKEY_ERROR(8901, "model.apikey.error"),
    MODEL_CHECK_FAILED(8902, "model.check.failed"),
    MODEL_API_KEY_NOT_FOUND(8903, "model.api.key.not.found"),
    MODEL_APIKEY_LOAD_ERROR(8904, "model.apikey.load.error"),
    MODEL_NAME_EXISTED(8905, "model.name.existed"),
    MODEL_NOT_EXIST(8906, "model.not.exist"),
    MODEL_GET_FINE_TUNING_FAILED(8907, "model.get.fine.tuning.failed"),
    MODEL_GET_SHELF_FAILED(8908, "model.get.shelf.failed"),
    PUBLIC_MODEL_GET_SHELF_FAILED(8909, "public.model.get.shelf.failed"),
    MODEL_DELETE_FAILED_APPLY_AGENT(8910, "model.delete.failed.apply.agent"),
    MODEL_DELETE_FAILED_APPLY_WORKFLOW(8911, "model.delete.failed.apply.workflow"),
    MODEL_URL_ILLEGAL_FAILED(8912, "model.url.illegal.failed"),
    NOT_CUSTOM_MODEL(8913, "not.custom.model"),

    // Notification center related errors 90xxx
    NOTIFICATION_NOT_EXISTS(90001, "notification.not.exists"),
    NOTIFICATION_SEND_FAILED(90002, "notification.send.failed"),
    NOTIFICATION_MARK_READ_FAILED(90003, "notification.mark.read.failed"),
    NOTIFICATION_DELETE_FAILED(90004, "notification.delete.failed"),
    NOTIFICATION_RECEIVER_EMPTY(90005, "notification.receiver.empty"),
    NOTIFICATION_TYPE_INVALID(90006, "notification.type.invalid"),
    NOTIFICATION_PERMISSION_DENIED(90007, "notification.permission.denied"),
    NOTIFICATION_EXPIRED(90008, "notification.expired"),
    NOTIFICATION_ALREADY_READ(90009, "notification.already.read"),

    // System errors 9xxxx
    SYSTEM_ERROR(99999, "system.error");

    @Getter
    private final int code;

    @Getter
    private final String messageKey;

    ResponseEnum(int code, String messageKey) {
        this.code = code;
        this.messageKey = messageKey;
    }
}
